package com.m3958.firstgwt.client.place;

import com.m3958.firstgwt.client.MyPlace;
import com.m3958.firstgwt.client.types.ViewNameEnum;

public class DiskFileEditPlace extends MyPlace{
	
	private String siteId;
	private String path;
	private String fileName;
	private String isFolder;
	private String rid;
	
	public DiskFileEditPlace(String allParas){
		String[] ss = allParas.split(",");
		setSiteId(ss[0]);
		if(ss.length > 1)setPath(ss[1]);
		if(ss.length > 2)setFileName(ss[2]);
		if(ss.length > 3)setIsFolder(ss[3]);
		if(ss.length > 4)setRid(ss[4]);
	}
	
	public DiskFileEditPlace(String siteId,String path,String fileName,String isFolder,String rid){
		this.siteId = siteId;
		this.path = path;
		this.fileName = fileName;
		this.isFolder = isFolder;
		this.rid = rid;
	}
	

	@Override
	public String getToken() {
		return ViewNameEnum.DISKFILE_EDIT.toString().toLowerCase() + "/" + siteId + "," + path + "," + fileName + "," + isFolder + "," + rid;
	}

	public String getSiteId() {
		return siteId;
	}

	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getIsFolder() {
		return isFolder;
	}

	public void setIsFolder(String isFolder) {
		this.isFolder = isFolder;
	}
	
	public boolean isaFoler(){
		return "true".equals(isFolder) || "1".equals(isFolder);
	}

	public String getRid() {
		return rid;
	}

	public void setRid(String rid) {
		this.rid = rid;
	}

}
